package com.hsj.springai.config;

public class AProxyServiceImpl implements AService{

    private AServiceImpl aService;

    public AProxyServiceImpl(AServiceImpl aService){
        this.aService = aService;
    }

    public void before(){
        System.out.println("在支付前做一些校验");
    }

    public void after(){
        System.out.println("在支付之后进行记录");
    }

    @Override
    public void pay(String id) {
         before();
        aService.pay(id);
        after();
    }

    @Override
    public void pay() {
        before();
        aService.pay();
        after();
    }

}
